//
//  KDRole.m
//  PublicSentimentMonitorSystem
//
//  Created by 魏强 on 15/12/14.
//  Copyright © 2015年 魏强. All rights reserved.
//

#import "KDRole.h"

@implementation KDRole
/**
 *  当一个对象要归档进沙盒中时，就会调用这个方法
 *  目的：在这个方法中说明这个对象的哪些属性要存进沙盒
 */
- (void)encodeWithCoder:(NSCoder *)encoder{
    [encoder encodeObject:@(self.keyword) forKey:@"keyword"];
    [encoder encodeObject:@(self.OSSearch) forKey:@"OSSearch"];
    [encoder encodeObject:@(self.author) forKey:@"author"];
    [encoder encodeObject:@(self.weiboSearch) forKey:@"weiboSearch"];
    [encoder encodeObject:@(self.yuJing) forKey:@"yuJing"];
    [encoder encodeObject:@(self.proxy) forKey:@"proxy"];
    [encoder encodeObject:@(self.app) forKey:@"app"];
    [encoder encodeObject:@(self.synAttach) forKey:@"synAttach"];
    [encoder encodeObject:@(self.weisite) forKey:@"weisite"];
    [encoder encodeObject:@(self.report) forKey:@"report"];
    [encoder encodeObject:@(self.search) forKey:@"search"];
    [encoder encodeObject:@(self.GKZF) forKey:@"GKZF"];
    [encoder encodeObject:@(self.OSKeyword) forKey:@"OSKeyword"];
    [encoder encodeObject:@(self.companyInfo_id) forKey:@"companyInfo_id"];
    
}

/**
 *  当从沙盒中解档一个对象时（从沙盒中加载一个对象时），就会调用这个方法
 *  目的：在这个方法中说明沙盒中的属性该怎么解析（需要取出哪些属性）
 */
- (id)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super init]) {
        self.keyword = [[aDecoder decodeObjectForKey:@"keyword"] integerValue];
        self.OSSearch = [[aDecoder decodeObjectForKey:@"OSSearch"] integerValue];
        self.author = [[aDecoder decodeObjectForKey:@"author"] integerValue];
        self.weiboSearch = [[aDecoder decodeObjectForKey:@"weiboSearch"] integerValue];
        self.yuJing = [[aDecoder decodeObjectForKey:@"yuJing"] integerValue];
        self.proxy = [[aDecoder decodeObjectForKey:@"proxy"] integerValue] ;
        self.app = [[aDecoder decodeObjectForKey:@"app"] integerValue];
        self.synAttach = [[aDecoder decodeObjectForKey:@"synAttach"] integerValue];
        self.weisite = [[aDecoder decodeObjectForKey:@"weisite"] integerValue];
        self.report = [[aDecoder decodeObjectForKey:@"report"] integerValue];
        self.search = [[aDecoder decodeObjectForKey:@"search"] integerValue];
        self.GKZF = [[aDecoder decodeObjectForKey:@"GKZF"] integerValue] ;
        self.OSKeyword = [[aDecoder decodeObjectForKey:@"OSKeyword"] integerValue] ;
        self.companyInfo_id = [[aDecoder decodeObjectForKey:@"companyInfo_id"] integerValue] ;

    }
    return self;
}

@end
